from django.contrib import admin
from django.contrib.contenttypes.admin import GenericTabularInline
from .models import (
    Note, Task, Plan, Issue, Project, Material, Book,
    BookStackRecord, Course, CourseStackRecord,
    PersonOfInterest, Story, Week, Timeline, Site
)


class NotesInline(GenericTabularInline):
    model = Note


class BookAdmin(admin.ModelAdmin):
    inlines = [
        NotesInline,
    ]


admin.site.register(Note)
admin.site.register(Week)
admin.site.register(Story)
admin.site.register(Task)
admin.site.register(Plan)
admin.site.register(Issue)
admin.site.register(Site)
admin.site.register(Project)
admin.site.register(Material)
admin.site.register(Book, BookAdmin)
admin.site.register(BookStackRecord)
admin.site.register(Course)
admin.site.register(CourseStackRecord)
admin.site.register(PersonOfInterest)
